package com.bestsoft.flow.service.impl;

import java.util.List;
import com.bestsoft.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bestsoft.flow.mapper.FlowOwnerDocMapper;
import com.bestsoft.flow.domain.FlowOwnerDoc;
import com.bestsoft.flow.service.IFlowOwnerDocService;

/**
 * 货主资料Service业务层处理
 * 
 * @author 崔健
 * @date 2023-07-11
 */
@Service
public class FlowOwnerDocServiceImpl implements IFlowOwnerDocService 
{
    @Autowired
    private FlowOwnerDocMapper flowOwnerDocMapper;

    /**
     * 查询货主资料
     * 
     * @param ownerid 货主资料主键
     * @return 货主资料
     */
    @Override
    public FlowOwnerDoc selectFlowOwnerDocByOwnerid(Long ownerid)
    {
        return flowOwnerDocMapper.selectFlowOwnerDocByOwnerid(ownerid);
    }

    /**
     * 查询货主资料列表
     * 
     * @param flowOwnerDoc 货主资料
     * @return 货主资料
     */
    @Override
    public List<FlowOwnerDoc> selectFlowOwnerDocList(FlowOwnerDoc flowOwnerDoc)
    {
        return flowOwnerDocMapper.selectFlowOwnerDocList(flowOwnerDoc);
    }

    /**
     * 新增货主资料
     * 
     * @param flowOwnerDoc 货主资料
     * @return 结果
     */
    @Override
    public int insertFlowOwnerDoc(FlowOwnerDoc flowOwnerDoc)
    {
        flowOwnerDoc.setCreateTime(DateUtils.getNowDate());
        return flowOwnerDocMapper.insertFlowOwnerDoc(flowOwnerDoc);
    }

    /**
     * 修改货主资料
     * 
     * @param flowOwnerDoc 货主资料
     * @return 结果
     */
    @Override
    public int updateFlowOwnerDoc(FlowOwnerDoc flowOwnerDoc)
    {
        flowOwnerDoc.setUpdateTime(DateUtils.getNowDate());
        return flowOwnerDocMapper.updateFlowOwnerDoc(flowOwnerDoc);
    }

    /**
     * 批量删除货主资料
     * 
     * @param ownerids 需要删除的货主资料主键
     * @return 结果
     */
    @Override
    public int deleteFlowOwnerDocByOwnerids(Long[] ownerids)
    {
        return flowOwnerDocMapper.deleteFlowOwnerDocByOwnerids(ownerids);
    }

    /**
     * 删除货主资料信息
     * 
     * @param ownerid 货主资料主键
     * @return 结果
     */
    @Override
    public int deleteFlowOwnerDocByOwnerid(Long ownerid)
    {
        return flowOwnerDocMapper.deleteFlowOwnerDocByOwnerid(ownerid);
    }
}
